package ca.cbc.gis.playground;

import java.io.IOException;
import java.util.List;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import ca.cbc.giscommon.dao.ShapeDAO;
import ca.cbc.giscommon.entity.Shape;
import ca.cbc.giscommon.util.HibernateUtil;

public class SandBox {
    @AfterClass
    public static void afterClass() {
        HibernateUtil.shutdown();
    }
    
    @BeforeClass
    public static void beforeClass() {
        HibernateUtil.createSessionFactory();
    }
    
    @Before
    public void before() {
    	HibernateUtil.beginTransaction();
    }
    
    @After
    public void after() {
    	HibernateUtil.commitTransaction();
    }
    
    @Test
    public void sandbox() throws IOException {
    	ShapeDAO dao = new ShapeDAO();
    	List<Shape> shapes = dao.list(null, null, "7", null, "id", true, 2, 0);
    	System.out.println("---------size: " + shapes.size() + " --------------");
    	for(Shape obj : shapes) {
    		System.out.println(obj);
    		break;
    	}
    }
}
